#include<iostream>
#include "student.h"

int main (int argc, char *argv[])
{
    Student A[20];
    for(int i = 0; i < 20; i++){
        A[i].setup_num(1901+i);
        if(i%3==0)
        A[i].setup_maj('M');
        else if(i%3==1)
        A[i].setup_maj('P');
        else
        A[i].setup_maj('C');
    }
    double random[21];
    int _random[21];
    for(int i=0;i<=20;i++){
    std::cin>>random[i];
    _random[i]=50*random[i];}
    for(int i=1;i<=20;i++)
        A[i-1].setup_gpa(_random[i]/10.0);
    for(int i=0;i<20;i++)
    A[i].print();
    std::cout<<"after heap"<<std::endl;
    heap S(A,20);
    S.sort(A);
    S.printout(A);
    std::cout<<"after merge"<<std::endl;    
    merge KC(A,20);
    for(int i=0;i<20;i++)
    std::cout<<A[i].out_num()<<",\t";
    std::cout<<std::endl;
    for(int i=0;i<20;i++)
    std::cout<<A[i].out_maj()<<",\t";
    std::cout<<std::endl;
    for(int i=0;i<20;i++)
    std::cout<<A[i].out_gpa()<<",\t";
    std::cout<<std::endl;
    return 0;
}